package utils
{
	/**
	 * 游戏里使用到的正则
	 * @author WynnLam
	 * 
	 */	
	public class RegExpUtil
	{
		//聊天表情编码正则
		public static const CHAT_FACE:RegExp = /%(4[0-7]|[1-3]?\d)/g;/*/%\d{1,2}/g;*/
		/** 大表情正则 **/
		public static const BIG_FACE:RegExp = /#\d+#/;
		//换行符\r
		public static const LINE_BREAK:RegExp = /\r+/g;
		//游戏名称正则
		public static const GAME_NAME:RegExp = /\$GAMENAME\$/g;
		//任务奖励正则,配置服务端下发的任务奖励信息串
		public static const QUEST_AWARDS_REG:RegExp = /<@QuestAwardDesc,(\d+)>/;
		//功能链接正则,<#BLcaption/func>,<#BNcaption/func>
		public static const FN_LINK_REG:RegExp = /<#B([^>]+)\/([^>]+)>[\\]*/g;
		/**速传样式指令正则#fmap:x:y:entity#**/
		public static const FAST_TRANSFER_LINK:RegExp = /#([Ff][^:#]+:\d+:\d+:[^:#]*)#/g;
		//空白字符和“\”号的正则
		public static const BLANK_REG:RegExp = /[\s\\]/g;
		//8位ARGB颜色
		public static const ARGB_COLOR:RegExp = /[a-fA-F0-9]{8}/;
		//html正则
		public static const HTML:RegExp = /<[^>]+>/g;
		//<font size='16' color='#d5eeff' >$content$</font> 替换HTML里面的内容
		public static const HTML_CONTENT:RegExp = /\$content\$/g;
		//替换html里面的超链接
		public static const HTML_HREF:RegExp = /\$href\$/g;
		
		//用于匹配<(/)(ident) (attr='value')>字符串的正则表达式
		public static const TAG_BLOCK_REG:RegExp = new RegExp("<([/]{0,1})([a-zA-Z_][a-zA-Z_0-9]*)([^>]*)>", "sg");
		//用于匹配(attr)='(value)'字符串的正则表达式
		public static const ATTR_BLOCK_REG:RegExp = new RegExp("([a-zA-Z_][a-zA-Z_0-9]*)[ \t]*=[ |\t]*'([^']*)'|([a-zA-Z_][a-zA-Z_0-9]*)[ \t]*=[ |\t]*\"([^\"]*)\"", "sg");//标志中不能使用x因为表达式中的空格有意义
		
		//数字正则
		public static const NUMBER:RegExp = /[0-9]/g;
		/**去掉尖括号的 /<|>/g**/
		public static const ANGLE_BRACKETS:RegExp = /<|>/g;
		/**去掉大括号的 /\{|\}/g**/
		public static const BRACE:RegExp = /\{|\}/g;
		/**匹配大括号包裹的内容 /{.*?}/**/
		public static const BRACE_CONTENT:RegExp = /{.*?}/;
		
		
	}
}